var sidebar = {
init:
    function () {
        sidebar.update_tag_cloud();
    },


update_tag_cloud :
    function() {
    get_tag_list_do(11, 
        function (state, data) {
            var tags = data;
            var tags_array = new Array();
            var min_count, max_count;
            max_count = tags[0].count;
            min_count = tags[tags.length-1].count;

            tags_array.push('<ul>');
            for (var i = 0; i < tags.length; i += 1) {   
                tags_array.push(
                    '<li><a id="'+ tags[i].id + '_tag-item" class="tag-item" href="#" '
                    + 'title="' + tags[i].name + ': tagged by '+tags[i].count+' notes">' + tags[i].name + '</a></li>'
                    /*
                    '<li><a id="'+ tags[i].id + '_tag-item" class="tag-item" href="#"  style="font-size:' + count2size(max_count, min_count, tags[i].count)+ 'px;" '
                    + 'title="' + tags[i].name + ': tagged by '+tags[i].count+' notes">' + tags[i].name + '</a></li>'
                    */);
            }
            tags_array.push('</ul>')
            $('#tag-block-content').html(tags_array.join(''));
            //bind actions
        },
        function (state, data) {
            notify('Load tag list fail');  
        }
    );
    },
}


